import request from '@/utils/request'
const ThirdWechatArticleRelationConfigService = {
  state: {},

  mutations: {},

  actions: {

    /**
     * 素材关联配置列表
     */
    thirdWechatArticleRelationConfigList({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.get('thirdWechatArticleRelationConfig/list', params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
    * 根据主键获得素材关联配置
    */
    thirdWechatArticleRelationConfigGetById({ commit }, id) {
      return new Promise((resolve, reject) => {
        request.get('thirdWechatArticleRelationConfig/getById/' + id).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
    * 根据主键获得素材关联配置详情
    */
    thirdWechatArticleRelationConfigGetDetailsById({ commit }, id) {
      return new Promise((resolve, reject) => {
        request.get('thirdWechatArticleRelationConfig/getDetailsById/' + id).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },

    /**
     * 素材关联配置保存
     */
    thirdWechatArticleRelationConfigSave({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.post('thirdWechatArticleRelationConfig/save', params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
     * 素材关联配置更新
     */
    thirdWechatArticleRelationConfigUpdate({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.post('thirdWechatArticleRelationConfig/update/' + params.id, params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
     * 素材关联配置删除
     */
    thirdWechatArticleRelationConfigRemove({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.post('thirdWechatArticleRelationConfig/remove', params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default ThirdWechatArticleRelationConfigService
